<?php

namespace App\Http\Controllers\Admin;


use App\Http\Controllers\Controller as BaseController;
use App\Repository\ShltAddressCodeRepository;
use Illuminate\Http\Request;

// 地址的查询
class ShltAddressCodeController extends BaseController
{
    public function __construct(ShltAddressCodeRepository $repository)
    {
        $this->repoist = $repository;
    }

    // 查询省市区
    public function index(Request $request)
    {
        $data = [];
        return $this->returnMsg(200, '查询成功', $data);
    }


    // 获取省
    public function provinces(Request $request)
    {
        return $this->repoist->provinces();
    }

    // 获取市
    public function citys(Request $request)
    {
        $prvinceId = $request->get('pid');
        return $this->repoist->citys($prvinceId);
    }

    // 获取区
    public function areas(Request $request)
    {
        $cityId = $request->get('pid');
        return $this->repoist->areas($cityId);
    }
}
